<template>
  <div class="home">
    <van-nav-bar :title="title" left-arrow @click-left="toHome">
      <template #right>
        <van-icon name="search" size="1rem" />
      </template>
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  props: ['title', 'router'],
  data() {
    return {}
  },
  methods: {
    toHome() {
      this.$router.push(this.router)
    }
  }
}
</script>
<style scoped>
.van-nav-bar {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  font-size: 0.5rem;
}
</style>
